package com.xu.cloud.common.constant;

/**
 * Http请求相关常量类
 *
 * @author xuguan
 * @since 2025/1/7
 * @see javax.servlet.http.HttpServlet
 * @see javax.servlet.http.HttpServletRequest
 * @see javax.servlet.http.HttpServletResponse
 * @see org.springframework.http.HttpMethod
 * @see org.springframework.http.MediaType
 * @see org.springframework.http.HttpHeaders
 * @see org.springframework.http.HttpStatus
 */
public interface HttpConstant extends Constant {

    String XU_CLOUD_RESPONSE_ATTRIBUTE_NAME = "xu_cloud_response_attribute";

    String API_VERSION_PLACEHOLDER = "{version}";

    String API_VERSION_PATTERN = "/v\\d+(\\.\\d+)*";
    String API_VERSION_V1 = "v1";
    String API_VERSION_V2 = "v2";
    String API_VERSION_V3 = "v3";

    String OPEN_API_PATTERN = "/api/open/**";

    String HEADER_TRACE_ID = "trace_id";
    String HEADER_ACCESS_TOKEN = "access_token";
    String HEADER_IDEMPOTENT_TOKEN = "idempotent_token";

    /**
     * 默认请求建立连接超时时间(3秒)
     */
    int CONNECT_TIMEOUT = 1000 * 3;
    /**
     * 默认请求读取响应超时时间(10秒)
     */
    int READ_TIMEOUT = 1000 * 10;
}
